/**
 * 
 */
package kevin.study.zephyr.domain.model.entity;

import kevin.study.zephyr.domain.model.Entity;

/**
 * @author Kevin.Huang
 * @createtime 2007-9-20
 */
public class IntegerEntity extends Entity< Integer > {

	/**
	 * 
	 */
	private static final long serialVersionUID = 802029450167576228L;

	/**
	 * 实例类型
	 */
	public static final String ENTITY_TYPE = "整型";

	/*
	 * (non-Javadoc)
	 * 
	 * @see kevin.study.zephyr.domain.model.Entity#setObject(java.lang.Object)
	 */
	@Override
	public void setObject(Object obj) {
		this.value = (Integer) obj;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see kevin.study.zephyr.domain.model.Entity#setValue(java.lang.String)
	 */
	@Override
	public void setStringValue(String value) {
		this.value = Integer.valueOf(value);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see kevin.study.zephyr.domain.model.Entity#toString()
	 */
	@Override
	public String toString() {
		return this.value.toString();
	}

    public String getTypeName() {
        return ENTITY_TYPE;
    }

	public int compareTo(Entity< Integer > o) {
		return this.getValue().compareTo(o.getValue());
	}

}
